package com.queen.restaurant.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.queen.restaurant.domain.Table;

@Repository
public class TableDao extends BaseDao<Table>{
	
	//根据餐厅id查找该餐厅下的所有餐桌
	public List<Table> getTablesByRestaurantId(String id){
		String hql = "from Table table where table.restaurant.id=?";
		return getHibernateTemplate().find(hql,id);
	}
	//根据餐桌id删除餐桌
	public void deleteTableById(int id){
		String hql = "delete from Table table where table.id=?";
		getHibernateTemplate().bulkUpdate(hql, id);
	}
}
